{extend name="layout/main"}
{block name='title'}交易管理{/block}

{block name='main'}
<div class="container-fluid cm-container-white">
    <h3 style="margin:0">交易订单管理
        <div class="nav nabbar-nav" role="navigation">
            <div>
                <form action="{:url('admin/order/index')}" method="get" class="navbar-form navbar-right">
                    <div class="form-group">
                        <label class="small">用户:</label>
                        <input type="text" value="{$uid}" class="form-control" name="uid" placeholder="请输入用户id"/>
                    </div>
                    <div class="form-group">
                        <label class="small">出版物:</label>
                        <input type="text" value="{$pid}" class="form-control" name="pid" placeholder="请输入出版物id"/>
                    </div>
                    <button type="submit" class="btn btn-default">提交</button>
                </form>
            </div>
        </div>
    </h3>
    <div class="table-responsive">
        <table class="table table-hover">
            <thead>
            <tr>
                <th>订单id</th>
                <th>用户</th>
                <th>联系方式</th>
                <th>地址</th>
                <th>补充地址</th>
                <th>订单金额</th>
                <th>实付金额</th>
                <th>邮寄公司</th>
                <th>邮寄号码</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach $data as $d}
            <tr>
                <td>{$d.id}</td>
                <td>{$d.username}</td>
                <td>{$d.phone}</td>
                <td>{$d.province . '-' . $d.city . '-' . $d.area}</td>
                <td>{$d.address}</td>
                <td>{$d.total_price}</td>
                <td>{$d.real_price}</td>
                <td>{$d.fms}</td>
                <td>{$d.fms_number}</td>
                <td>
                    {switch name="$d.status"}
                    {case value="0"}未支付{/case}
                    {case value="1"}已支付{/case}
                    {case value="2"}已发货{/case}
                    {case value="3"}已收货{/case}
                    {case value="4"}交易关闭{/case}
                    {case value="5"}退款{/case}
                    {case value="6"}退货{/case}
                    {default /}订单状态未知
                    {/switch}
                </td>
                <td>
                    <a class="btn btn-primary" href="{:url('admin/order/save', ['oid' => $d.id])}">详细信息及修改</a>
                    <!--<button class="btn btn-danger delUser" type="button">删除</button>-->
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
    </div>
    <div class="text-center">
        {$data->render()}
    </div>
</div>

{/block}

{block name='js'}
<script>
    $(function () {
        $('#cm-menu-scroller > ul > li:nth-child(7)').addClass('active');

        $("[data-toggle='tooltip']").tooltip();
    });

</script>
{/block}